#include <iostream>
using namespace std;
class Shape
{
public:
    virtual double Area( )=0;
protected:
    double area;
};
class Square:public Shape
{
public:
    Square(double l=1):line(l)
    {

    }
    double Area( )
    {
        return line*line;
    }
protected:
    double line;
};
class Retangle:public Shape
{
public:
    Retangle(double w=1,double h=1):width(w),heigit(h)
    {
    }
    double Area( )
    {
        return width*heigit;
    }
protected:
    double width, heigit ;
};
int main( )
{
    Shape *p;
    Square obj1(5.1);
    p = &obj1;
    cout<<p->Area( )<<endl;
    Retangle obj2(5,3.6);
    p = &obj2;
    cout<<p->Area( )<<endl;
    return 0;
}

